require("../../../utils/api.js");

var o = require("../../../utils/disapi.js"), e = getApp();

Page({
    data: {
        used_money: 0,
        money: 0,
        cash_money: 0,
        openid: ""
    },
    onLoad: function(n) {
        wx.setNavigationBarColor({
            frontColor: wx.getStorageSync("basic").topcolor,
            backgroundColor: wx.getStorageSync("basic").topbg
        });
        var a = e.globalData.openid;
        this.setData({
            openid: a
        });
        var t = this, i = getCurrentPages(), s = (i[i.length - 1], i[i.length - 2]), d = "";
        if (void 0 == s) ; else {
            var r = s.data;
            console.log(r), t.setData({
                userinfo: r.user,
                headinfo: r.headInfo,
                openid: a
            }), d = r.headinfo.m_id + "#" + r.userinfo.m_id, console.log(d);
        }
        o.get_dis_user_info({
            openid: this.data.openid,
            scene: d
        }).then(function(o) {
            console.log(o);
            var e = o.data;
            console.log(e), 0 == e.code && (console.log("1"), t.setData({
                nickname: e.data.m_nickname,
                used_money: parseFloat(e.data.used_mondey),
                money: parseFloat(e.data.money),
                cash_money: parseFloat(e.data.cash_money)
            }));
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});